﻿namespace g_gongjianta
{
    public class AbstractTriggerRecord
    {
        private static ulong mSrlSend = 10000;
        public ulong Srl { get; protected set; }
        public bool IsTriggered { get; protected set; }
        public int SkillId { get; protected set; }

        protected void Trigger(int skill_id = 0)
        {
            Srl = mSrlSend++;
            IsTriggered = true;
            SkillId = skill_id;
        }

        public virtual void Clear()
        {
            IsTriggered = false;
            SkillId = 0;
        }
    }

    public class TriggerWholeRecord : AbstractTriggerRecord
    {
        public int State { get; private set; }

        public void Trigger(int state = 0, int skill_id = 0)
        {
            State = state;
            //Core.log.err($"Trigger state={state} skill_id = {skill_id}");
            base.Trigger(skill_id);
        }

        public override void Clear()
        {
            base.Clear();
            State = 0;
        }
    }
}
